package com.gjb6.master.messageDao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.gjb6.master.messageDao.Message;
import com.gjb6.master.messageDao.UserBeans;
import com.gjb6.master.messageDao.Info;

import com.gjb6.master.messageDao.MessageDao;
import com.gjb6.master.messageDao.UserBeansDao;
import com.gjb6.master.messageDao.InfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig messageDaoConfig;
    private final DaoConfig userBeansDaoConfig;
    private final DaoConfig infoDaoConfig;

    private final MessageDao messageDao;
    private final UserBeansDao userBeansDao;
    private final InfoDao infoDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        messageDaoConfig = daoConfigMap.get(MessageDao.class).clone();
        messageDaoConfig.initIdentityScope(type);

        userBeansDaoConfig = daoConfigMap.get(UserBeansDao.class).clone();
        userBeansDaoConfig.initIdentityScope(type);

        infoDaoConfig = daoConfigMap.get(InfoDao.class).clone();
        infoDaoConfig.initIdentityScope(type);

        messageDao = new MessageDao(messageDaoConfig, this);
        userBeansDao = new UserBeansDao(userBeansDaoConfig, this);
        infoDao = new InfoDao(infoDaoConfig, this);

        registerDao(Message.class, messageDao);
        registerDao(UserBeans.class, userBeansDao);
        registerDao(Info.class, infoDao);
    }
    
    public void clear() {
        messageDaoConfig.getIdentityScope().clear();
        userBeansDaoConfig.getIdentityScope().clear();
        infoDaoConfig.getIdentityScope().clear();
    }

    public MessageDao getMessageDao() {
        return messageDao;
    }

    public UserBeansDao getUserBeansDao() {
        return userBeansDao;
    }

    public InfoDao getInfoDao() {
        return infoDao;
    }

}
